package com.difsonapps.android.joinme.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Utils {

	private static String USER_SERVICE_URL = "rest/user";
	private static String LOGIN_SERVICE_URL = "rest/login";
	
	private static SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm"); 
	
	
	public static String dateToString(Date date){
		return dateFormat.format(date);
	}
	
	
	public static Date stringToDate(String date) throws ParseException{
		return dateFormat.parse(date);
	}
	
	
	public static String restCreateUser()
	{
		return USER_SERVICE_URL;
	}
	
	public static String restLogin()
	{
		return LOGIN_SERVICE_URL;
	}
	
	public static String restGetUserId(long id)
	{
		return USER_SERVICE_URL+"/id/"+id;
	}
	
	public static String restGetUserPhone(String phone)
	{
		return USER_SERVICE_URL+"/phone/"+phone;
	}
}
